<template>
  <div class="foo">
    <span v-for="(item, index) in footer" :key="index" @click="gaoliang(index)" :class="{ active: current == index }">
      <div>
        <img src="https://qq.yh31.com/tp/zjbq/201612042149569452.jpg" alt="" />
      </div>
      {{ item }}
    </span>
  </div>
</template>

<script>
export default {
  name: "MyFooter",
  data() {
    return {
      current: 0,
      footer: ["首页", "订单", "我的"],
    };
  },
  methods: {
    gaoliang(index) {
      this.current = index;
    },
  },
};
</script>

<style lang='scss' scoped>
.foo {
  width: 100%;
  height: 50px;
  background-color: #fff;
  position: fixed;
  bottom: 0;
  border-top: 1px solid rgba(128, 128, 128, 0.434);
  display: flex;
  align-items: center;
  justify-content: space-around;
}
img {
  width: 25px;
  height: 25px;
  text-align: center;
}
.active {
  color: lightseagreen;
}
</style>